ci: introduce towncrier for fragment-based changelog management#16
ci: introduce towncrier for fragment-based changelog management#16MikeGoldsmith wants to merge 4 commits into
Conversation
Replace manual CHANGELOG.md editing with towncrier fragments. Each PR adds a small file under <package>/.changelog/ instead of editing CHANGELOG.md directly, eliminating merge conflicts on backports and concurrent PRs. Every publishable package in this repo releases independently, so each gets its own [tool.towncrier] config and .changelog/ directory. Changes: - Add [tool.towncrier] block to each package's pyproject.toml (7 instrumentations + util-genai) - Add .changelog/.gitignore stub per package - Insert do-not-edit comment and <!-- changelog start --> marker above the Unreleased header in each CHANGELOG.md - Add shared scripts/changelog_template.j2 - Add .github/workflows/changelog.yml: blocks direct CHANGELOG.md edits, requires a fragment, previews the rendered changelog per package. Skipped via the "Skip Changelog" label - Add tox -e changelog-preview for local previewing - Add towncrier to root dev dependencies - Update CONTRIBUTING.md with fragment authoring instructions Assisted-by: Claude Opus 4.7 (1M context)
- Remove changelog-preview from tox envlist so the workflow generator doesn't create a CI job for it. The env stays available for local use and the changelog.yml workflow already runs the preview in CI. - Regenerate uv.lock with the index URL form the uv-lock pre-commit hook uses (trailing slash), matching upstream. Assisted-by: Claude Opus 4.7 (1M context)
lmolkova
left a comment
There was a problem hiding this comment.
Not sure if it's ready for review, but looks great on the first sight!
Addresses review feedback on PR open-telemetry#16 to mirror the new CONTRIBUTING.md guidance for AI-assisted contributions in a more concise form. Assisted-by: Claude Opus 4.7 (1M context)
|
Ready for review now - I left it in draft while I fixed up the 'Skip Changelog' label, which is working now 👍🏻 |
There was a problem hiding this comment.
Pull request overview
This PR introduces towncrier-based changelog management across the independently released packages in the repository, replacing direct CHANGELOG.md edits with per-package changelog fragments.
Changes:
- Adds towncrier configuration and
.changelog/directories for instrumentation packages andopentelemetry-util-genai. - Adds changelog preview support via tox, a shared towncrier template, and a new GitHub Actions changelog check.
- Updates contributor/agent documentation and root dev dependencies for the new changelog workflow.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/changelog.yml |
Adds CI enforcement and previewing for changelog fragments. |
AGENTS.md |
Documents changelog fragment expectations for agents. |
CONTRIBUTING.md |
Replaces direct changelog instructions with towncrier fragment guidance. |
pyproject.toml |
Adds towncrier to the root dev dependency group. |
scripts/changelog_template.j2 |
Adds the shared towncrier rendering template. |
tox.ini |
Adds the changelog-preview tox environment. |
uv.lock |
Locks towncrier and its transitive dependencies. |
instrumentation/opentelemetry-instrumentation-anthropic/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-anthropic/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-anthropic/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-claude-agent-sdk/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-claude-agent-sdk/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-claude-agent-sdk/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-google-genai/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-google-genai/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-google-genai/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-langchain/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-langchain/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-langchain/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-openai-agents-v2/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-openai-agents-v2/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-openai-agents-v2/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-openai-v2/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-openai-v2/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-openai-v2/pyproject.toml |
Adds package-specific towncrier configuration. |
instrumentation/opentelemetry-instrumentation-weaviate/CHANGELOG.md |
Adds towncrier management notice and marker. |
instrumentation/opentelemetry-instrumentation-weaviate/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
instrumentation/opentelemetry-instrumentation-weaviate/pyproject.toml |
Adds package-specific towncrier configuration. |
util/opentelemetry-util-genai/CHANGELOG.md |
Adds towncrier management notice and marker. |
util/opentelemetry-util-genai/.changelog/.gitignore |
Keeps the changelog fragment directory tracked. |
util/opentelemetry-util-genai/pyproject.toml |
Adds package-specific towncrier configuration. |
- Re-trigger the changelog workflow on labeled/unlabeled events so adding the "Skip Changelog" label without pushing a new commit is enough to clear a previously failed run. - Validate fragment basenames against <PR_NUMBER>.<type> in the workflow, catching typos in either the PR number or the fragment type before they ship a misleading changelog link. - Note in each CHANGELOG.md do-not-edit comment that the existing static "## Unreleased" entries must be folded into the first towncrier-built release manually. Assisted-by: Claude Opus 4.7 (1M context)
| containing a one-line description. Types: `added`, `changed`, `deprecated`, `removed`, `fixed`. | ||
| - Don't include the PR number in the body — towncrier appends it from the filename. | ||
| - Preview locally with `uv run tox -e changelog-preview`. | ||
| - If the change needs no entry (pure docs or tooling), add the `Skip Changelog` label to the PR. |
There was a problem hiding this comment.
I think this might send agents on a wrong path - most contributors don't have write access but their agents might try to add labels. let's remove?
| - If the change needs no entry (pure docs or tooling), add the `Skip Changelog` label to the PR. |
| - Preview locally with `uv run tox -e changelog-preview`. | ||
| - If the change needs no entry (pure docs or tooling), add the `Skip Changelog` label to the PR. | ||
|
|
||
| See [CONTRIBUTING.md](CONTRIBUTING.md#4-update-the-changelog) for full details. |
There was a problem hiding this comment.
| See [CONTRIBUTING.md](CONTRIBUTING.md#4-update-the-changelog) for full details. |
it's already linked somewhere in this doc, no need to repeat
Addresses Copilot review feedback: the changelog steps depend on open-telemetry#16 (towncrier setup) which hasn't merged yet. Make the dependency explicit at the top of the doc so it's obvious to any reviewer. Assisted-by: Claude Opus 4.7 (1M context)
The note belongs in the PR description as a merge-ordering signal, not in the doc itself where it would have to be removed once open-telemetry#16 lands. Assisted-by: Claude Opus 4.7 (1M context)
Summary
Adopt towncrier for fragment-based changelog management. PRs with user-visible impact add a file under
<package>/.changelog/<PR>.<type>rather than editingCHANGELOG.md, which removes the merge-conflict footgun on backports and concurrent PRs.Every publishable package here releases independently, so each gets its own
[tool.towncrier]config and.changelog/directory — mirroring the independent-package pattern inopentelemetry-python-contrib.What's in this PR:
[tool.towncrier]block in each package'spyproject.toml(7 instrumentations +util-genai)<package>/.changelog/.gitignoreper package<!-- changelog start -->marker above each existing## Unreleasedheadingscripts/changelog_template.j2.github/workflows/changelog.yml: blocks directCHANGELOG.mdedits, requires a fragment, previews rendered changelogs per package; skipped via theSkip Changeloglabeltox -e changelog-previewfor local previewingtowncrierin root dev dependenciesCONTRIBUTING.mdupdated with fragment authoring instructions, and a condensed version added toAGENTS.mdPart of #15.
Notes
Skip Changeloglabel since the change is pure tooling.Skip ChangelogandStalelabels were created on this repo as a prerequisite.prepare-releaseis intentionally not created yet — to be added when release tooling lands (planned name:Prepare Release).tox -e changelog-previewruns cleanly across all 8 packages.